package io.github.junxworks.qt.constants;

import java.util.Date;

public enum FieldType {
	STRING("string", String.class, "字符串"),
	INTEGER("int", int.class, "整数"),
	DOUBLE("double", double.class, "浮点数"),
	BOOLEAN("boolean", boolean.class, "布尔型"),
	LONG("long",long.class,"长整形"),
	DATE("date", Date.class, "日期型");

	/** value. */
	private String value;

	private Class<?> clazz;

	/** desc. */
	private String desc;

	/**
	 * 构造一个新的 yes no 对象.
	 *
	 * @param value the value
	 * @param desc the desc
	 */
	FieldType(String value, Class<?> clazz, String desc) {
		this.value = value;
		this.clazz = clazz;
		this.desc = desc;
	}

	public static FieldType getEnum(String value) {
		for (FieldType obj : FieldType.values()) {
			if (obj.value.equals(value)) {
				return obj;
			}
		}
		return null;
	}

	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}

	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}

	public Class<?> getClazz() {
		return clazz;
	}

	public void setClazz(Class<?> clazz) {
		this.clazz = clazz;
	}

}
